package com.jml.spring.springboot.springmvc.controller;

import com.jml.spring.springboot.springmvc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Controller
public class IndexController {

	@Autowired
	private UserService userService;

	//返回json
	@RequestMapping(value = "/index",produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String index(){
		return "纯手写springboot  ok";
	}

	//跳转页面
	@RequestMapping(value = "/page",produces = "text/html;charset=UTF-8")
	public String pageIndex(){
		String serviceInfo = userService.index();
		System.out.println(serviceInfo);
		return "pageIndex";
	}
}
